<?

if($Db->connect()){

  if($_SESSION["modify_mode"] == "Y"){


  }else{


  }

  echo  "<table border='1' class='dedeq'>\n".
        "<tr>\n".
        "<th> No        </th>\n".
        "<th> Drop      </th>\n".
        "<th> Model     </th>\n".
        "<th> Model-Id  </th>\n".
        "<th> Qty       </th>\n".
        "<th> SN        </th>\n".
        "</tr>\n";

  for($iRow = 0; $iRow < $_SESSION["init_num"]; $iRow++){

    $propModel    = $GJs->jsOnFocus("GMisc.setYellow2(this);
                                     Ajax.model(\"fromEnt\",
                                                this);").

                    $GJs->jsOnBlur ("GMisc.setWhite2(this);");

    $propModelId  = $GJs->jsOnFocus("GMisc.setYellow2(this);
                                     Ajax.modelId(\"modelEnt[".$iRow."]\",
                                                  this);").

                    $GJs->jsOnBlur ("GMisc.setWhite2(this);");

    $propQty    = $GJs->jsOnFocus("GMisc.setYellow2(this);").

                  $GJs->jsOnBlur ("GMisc.setWhite2(this);
                                   Ajax.isQtySufficient(\"fromEnt\",
                                                        \"modelIdEnt[".$iRow."]\",
                                                        this);");

    $propSnEntry =  $GJs->jsOnClick("Misc.snEntry(\"modelEnt[".$iRow."]\",
                                                  \"modelIdEnt[".$iRow."]\",
                                                  \"qtyEnt[".$iRow."]\",
                                                  \"".$_SESSION["tmpJid"]."\",
                                                  \"fromEnt\",
                                                  \"".$_SERVER["HTTP_HOST"]."\");");

    $lstModel   = $Misc->retArray($_POST["modelEnt"][$iRow]);

    echo  "<tr>\n".

            "<td> ".($iRow + 1)." </td>\n".

            "<td> ".$GHtml->formCheckBox("dropBox[]",
                                         ($iRow + 1),
                                         $Misc->stdProperties())." </td>\n".

            "<td> ".$GHtml->formDropDown("modelEnt[".$iRow."]",
                                         $_POST["modelEnt"][$iRow],
                                         $lstModel,
                                         $propModel)." </td>\n".

            "<td> ".$GHtml->formInput("modelIdEnt[".$iRow."]",
                                      $_POST["modelIdEnt"][$iRow],
                                      $Misc->stdStyle(12).
                                      $propModelId)." </td>\n".

            "<td> ".$GHtml->formInput("qtyEnt[".$iRow."]",
                                      $_POST["qtyEnt"][$iRow],
                                      $Misc->stdNumStyle(5).
                                      $propQty)." </td>\n".

            "<td> ".$GHtml->formInputButton("Entry",
                                            "snEnt[".$iRow."]",
                                            $_POST["snEnt"][$iRow],
                                            $propSnEntry)." </td>\n".

          "</tr>\n";
  }

  echo  "</table><br/>\n";

  echo  $GHtml->formInputButton( "Entry-data",
                                 "entry",
                                 "Entry-data",
                                 $stlButton).
  			$GHtml->formInputButton( "Add-row",
                                 "addrow",
                                 "Add-row",
                                 $stlButton).
        $GHtml->formInputButton( "Drop-row",
                                 "droprow",
                                 "Drop-row",
                                 $stlButton).
      	"</form>\n ".
      	"</body>\n";

  $Db->dc();
}else{

  $Misc->usrDie(_DB_CONN_ERROR);
}

?>